#ifndef __STORMWIDGET_STORMWIDGET_UILIBRARY_CDIALOGBUILDER_DIALOGBUILDER_H
#define __STORMWIDGET_STORMWIDGET_UILIBRARY_CDIALOGBUILDER_DIALOGBUILDER_H

#include "Markup.h"

class CControlUI;
class CMarkupNode;

class IDialogBuilderCallback
{
public:
	virtual CControlUI* CreateControl(LPCTSTR pstrClass) = 0;
};

class CDialogBuilder
{
public:
	CDialogBuilder(void);
	virtual ~CDialogBuilder(void);
public:
	CControlUI* Create(LPCTSTR pstrXML, IDialogBuilderCallback* pCallback = NULL);
	CControlUI* CreateFromResource(UINT nRes, IDialogBuilderCallback* pCallback = NULL);
private:
	CControlUI* _Parse(CMarkupNode* parent, CControlUI* pParent = NULL);

	CMarkup m_xml;
	IDialogBuilderCallback* m_pCallback;
};
#endif //__STORMWIDGET_STORMWIDGET_UILIBRARY_CDIALOGBUILDER_DIALOGBUILDER_H